<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title th:text="${title}+'-'+${@config.getKey('site.name')}"></title>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
    <link rel="stylesheet" th:href="@{/css/css.css}"/>
</head>
<body>
<div class="w1170" th:include="common/head::#h" style="padding-bottom: 10px;overflow:visible;"></div>

<div class="w1170">

    <div class="pLeft">

        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-search"></i>
                <span class="head">条件检索</span>
            </div>
            <div class="data_search">
                <div>
                    <table>
                        <tr>
                            <td width="80px" style="padding-top: 0px;padding-bottom: 28px;"><font
                                    class="stitle">资源类别：</font></td>
                            <td>
                                <ul>
                                    <li><a href="/"><span id="t_0">全部</span></a></li>
                                    <li th:each="arcType:${allArcTypeList}">
                                        <a th:href="'/article/list/1?typeId='+${arcType.srcTypeId}" th:title="'已有资源数：'+${arcType.allSize}">
                                            <span th:id="'t_'+${arcType.srcTypeId}" th:text="${arcType.srcTypeName}"></span>
                                        </a>
                                    </li>
                                </ul>
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                        </tr>
                        <tr style="border-top: dashed 1px #e6e6e6;height: 60px;">
                            <td width="80px" style="padding-top: 0px;"><font class="stitle">关键词：</font></td>
                            <td>
                                <form action="/article/search" onsubmit="return submitData()">
                                    <div class="layui-row">
                                        <div class="layui-col-md10">
                                            <input type="text" th:value="${q}" id="q" name="q" autocomplete="off"
                                                   class="layui-input" style="height: 30px"/>
                                        </div>
                                        <div class="layui-col-md2">
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit"
                                                                                       class="layui-btn layui-btn-radius layui-btn-sm"
                                                                                       value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;搜索&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "/>
                                        </div>
                                    </div>
                                </form>
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                </div>
            </div>
        </div>


        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-template-1"></i>
                <span class="head">搜索&nbsp;"<font color="red" th:text="${q}"></font>"&nbsp;的结果(总共搜索到&nbsp;<font
                        color="red" th:text="${resultTotal}"></font>&nbsp;条记录)</span>
            </div>
            <div class="data_result">
                <div th:if="${resultTotal==0}" align="center" style="padding-top: 20px">未查询到结果，请换个关键字试试看！</div>
                <ul th:if="${resultTotal!=0}">
                    <li th:each="article:${articleList}" style="margin-bottom: 20px">
                        <span class="title"><a target="_blank" th:href="'/article/detail/'+${article.articleId}"
                                               th:title="${article.articleName}" th:utext="${article.articleName}"></a></span>
                        <span class="summary" th:utext="'摘要:'+${article.articleContent}+'...'"></span>
                        <span class="link"><a target="_blank" th:href="'/article/detail/'+${article.articleId}"
                                              th:text="${@config.getKey('site.url')}+'/article/detail/'+${article.articleId}"></a>&nbsp;&nbsp;&nbsp;&nbsp;<font
                                class="publishDate" th:text="'发布日期：'+${#dates.format(article.articlePublishDate,'yyyy-MM-dd hh:mm:ss')}"></font></span>
                    </li>
                </ul>
            </div>
            <div align="center" style="" th:utext="${pageCode}"></div>
        </div>

    </div>

    <div class="pRight">


        <div class="data_list">
            <div class="data_list_title">
                <i class="layui-icon layui-icon-fire"></i>
                <span class="head">热门资源</span>
            </div>
            <div class="datas">
                <ul>
                    <li th:each="hotArticle:${hotArticleList}">
                        <a target="_blank" th:href="'/article/detail/'+${hotArticle.articleId}" th:title="${hotArticle.articleName}"
                           th:text="${#strings.length(hotArticle.articleName)>20} ? ${#strings.substring(hotArticle.articleName,0,21)} : ${hotArticle.articleName}"></a>
                    </li>
                </ul>
            </div>
        </div>

    </div>

</div>


<div class="w1170" th:include="common/link::#h"></div>

<div class="w1170" th:include="common/foot::#h" style="padding-top: 40px"></div>

<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.js}" type="text/javascript"></script>
<script th:src="@{/js/common.js}" type="text/javascript"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    layui.use(['element', 'form', 'laypage'], function () {
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
        var tMenu = [[${session.tMenu}]];
        $("#" + tMenu).css("color", "red");
    });

    function submitData() {
        var q = $("#q").val();
        if (q == "") {
            layer.msg("请输入关键字！");
            $("#q").focus();
            return false;
        }
    }

    /*]]>*/
</script>
</body>
</html>